[fixed] switched from KeyboardEvent.keyCode to KeyboardEvent.code#953
[fixed] switched from KeyboardEvent.keyCode to KeyboardEvent.code#953diasbruno merged 5 commits intoreactjs:masterfrom
Conversation
KeyboardEvent.keyCode is deprecated. Since React 18 dropped support for IE, we don't need to fall back on it and can simply switch to the new property, KeyboardEvent.code.
|
Sorry for the wait here, @diasbruno—pretty busy and the testing setup makes contributing less straightforward than I expected. I've followed-up on discussions above 🙂 |
|
@diasbruno as mentioned in #953 (comment) I tweaked the test helpers and added a couple of tests that cover the Also FYI: locally I have ~2-4 unrelated tests failing, they seem a bit flaky. I'm running Node 14, maybe that's it? (I've seen Node 8 mentioned in some config files, but surely that's a leftover.) Anyways since it's also failing on master for me, it's unrelated to this PR Let me know if there's anything else or if we can move forward with this 🙂 |
|
Grande lavoro! 🎉 I'll finish the review later, but it seems that everything looks great. Thanks for the contribution. |
|
Amazing! Thanks @diasbruno 🙂 |
|
@diasbruno just checking in 🙂 let me know if there's something else I can do on my side! |
|
(PS. no offence meant at all, just stumbled upon the issue again and I wanted to check if there's anything we can do to bring the change over the line 🙂 but totally understand that it can take some time) |
|
@robinmetral Thanks for pinging me...It's been hard to find time to manage this repo. |
|
Done. @robinmetral sorry for taking so long...:joy: |
|
No worries at all, and thanks a lot for the review and release! 🙌 |
|
@robinmetral Just released version 3.16.1. Thanks for taking the time to work on this. |

Fixes #952.
Changes proposed:
KeyboardEvent.code. The legacyKeyboardEvent.keyCodeis deprecated. Since React 18 dropped support for IE, we don't need to fall back on it, and can simply switch to the new propertyAcceptance Checklist:
CONTRIBUTING.md.Documentation (README.md) and examples have been updated as needed.If this is a code change, a spec testing the functionality has been added.If the commit message has [changed] or [removed], there is an upgrade path above.